package com.linchong.concurrency.publish;

import com.linchong.concurrency.annoations.UnThreadSafe;
import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;

/**
 * @author linchong
 * @version 1.0
 * @Date: 2020-12-08 17:15
 * @Description: UnsafePublish$
 */
@Slf4j
@UnThreadSafe
public class UnsafePublish {

	private String[] states = {"a","b","c"};

	public String[] getStates(){
		return states;
	}

	public static void main(String[] args) {
		UnsafePublish  unsafePublish = new UnsafePublish();
		log.info("{}", Arrays.toString(unsafePublish.getStates()));

		unsafePublish.getStates()[0] = "d";
		log.info("{}", Arrays.toString(unsafePublish.getStates()));

	}
}
